define(function (require, exports, module) {

	require('bootstrap-js');
	require('/assets/libs/common/bootstrap-model-hack.js');
	require('util');

	window.$ = window.jQuery = require('jquery');

	exports.load = function (name) {

		name = window.app.basePath + '/admin/js/'+name;

		seajs.use(name,function(module){
			if( $.isFunction(module.run)){
				module.run();
			}
		})
	};

	$( document ).ajaxSend(function(a, b, c) {
		if (c.type == 'POST' || c.type == 'DELETE') {
			b.setRequestHeader('X-CSRF-Token', $('input[name=csrf-token]').val());
		}
	});

	window.app.load = exports.load;

	if (app.controller) {
		exports.load(app.controller);
	}
});